Performance : close or not close a module

Hi all,

 

I have dxl a script that analyzes all sub modules of a top module, in order to generate a traceability report.

During the execution the script analyzes all in/out-link of each object (in each opened module) to check if the target object of the link has attributes set to the right value. For that we have to open the target module before reading attributes of the target object. At the end of the script, we have opened a lot of modules (Module m = read(nameOfModule, false)).

 

My question is : is it better to close module when the calcul is done (to free memory) or should I let all modules opened ? (knowing that modules could be reopened later..or not)

 

Thanks in advance !


Joooris - Wed Jul 05 11:09:41 EDT 2017

Re: Performance : close or not close a module
Mathias Mamsch - Mon Jul 17 06:43:42 EDT 2017

If you want to work this script on the large scale, the answer is: 

- cache all the links and relevant information. 

- Read the modules one by one, show a nice progress bar, close each module after reading. 

- See also the topic about large scale DXL: 

https://www.ibm.com/developerworks/community/forums/html/topic?id=9ebf4c77-b8e6-43d9-991a-adf0fabbae94&ps=25

https://www.ibm.com/developerworks/community/forums/html/topic?id=25c85c97-6af7-4051-ab8e-7dd6ae03b0cb&ps=25

Regards, Mathias

Re: Performance : close or not close a module
HPM2BP - Mon Jul 17 09:05:04 EDT 2017

Hello!

 

In my opinion it depends on the size of the modules, and the number of them. It's also important to know, will you open them twice, three times, multiple times?

If there's a possibility of opening the modules multiple times, I'd suggest keeping them open. If not, it's a good idea to close them when you are done with them.

 

Best regards,

Peter